<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic id="topic1">
  <title>postgres_fdw</title>
  <body>
    <p>The <codeph>postgres_fdw</codeph> module is a foreign data wrapper (FDW) 
      that you can use to access data stored in a remote PostgreSQL or Greenplum
      database.</p>
    <p>The Greenplum Database <codeph>postgres_fdw</codeph> module is a modified
      version of the PostgreSQL <codeph>postgres_fdw</codeph> module. The module
      behaves as described in the PostgreSQL
      <xref href="https://www.postgresql.org/docs/9.4/postgres-fdw.html" format="html"
        scope="external">postgres_fdw</xref> documentation when you use it to
      access a remote PostgreSQL database. <note>There are some restrictions and
      limitations when you use this foreign data wrapper module to access
      Greenplum Database, described below.</note></p>
  </body>
  <topic id="topic_reg">
    <title>Installing and Registering the Module</title>
    <body>
      <p>The <codeph>postgres_fdw</codeph> module is installed when you install
        Greenplum Database. Before you can use the foreign data wrapper, you
        must register the <codeph>postgres_fdw</codeph> extension in each
        database in which you want to use the foreign data wrapper.
        <ph otherprops="pivotal">Refer to <xref href="../../install_guide/install_modules.html"
          format="html" scope="external">Installing Additional Supplied Modules</xref>
        for more information.</ph></p>
    </body>
  </topic>
  <topic id="topic_gp_limit">
    <title>Greenplum Database Limitations</title>
    <body>
      <p>When you use the foreign data wrapper to access Greenplum Database,
        <codeph>postgres_fdw</codeph> has the following limitations:</p>
        <ul>
          <li>The <codeph>ctid</codeph> is not guaranteed to uniquely identify
            the physical location of a row within its table. For example, the
            following statements may return incorrect results when the foreign
            table references a Greenplum Database table:
            <codeblock>INSERT INTO rem1(f2) VALUES ('test') RETURNING ctid;
SELECT * FROM ft1, t1 WHERE t1.ctid = '(0,2)'; </codeblock></li>
          <li><codeph>postgres_fdw</codeph> does not support local or remote
            triggers when you use it to access a foreign table that references
            a Greenplum Database table.</li>
          <li><codeph>UPDATE</codeph> or <codeph>DELETE</codeph> operations on
            a foreign table that references a Greenplum table are not guaranteed
            to work correctly.</li>
        </ul>
    </body>
  </topic>
  <topic id="topic_info">
    <title>Additional Module Documentation</title>
    <body>
      <p>Refer to the <xref href="https://www.postgresql.org/docs/9.4/postgres-fdw.html" format="html"
        scope="external">postgres_fdw</xref> PostgreSQL documentation for detailed
        information about this module.</p>
    </body>
  </topic>
</topic>
